import { defineComponent } from "vue";
import "./index.less";
import Text from "../Text";
import { textViewProps } from "./types";
export default defineComponent({
  name: "",
  props: textViewProps,
  emits: ["click"],
  setup(_, { slots, emit }) {
    return () => {
      const getLimit = () => {
        if (_.limitedNumber == undefined) {
          return 2;
        } else {
          return _.limitedNumber;
        }
      };
      return (
        <Text
          class="ellipsis "
          style={{ "-webkit-line-clamp": getLimit() }}
          onClick={() => emit("click")}
        >
          {slots.default?.()}
        </Text>
      );
    };
  },
});
